import React from 'react';
import { WeaFormItem, WeaCheckbox , WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

class EShowHeader extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            showHeader: this.props.value || '0',
        }
    }

    getSaveValues() {
        return this.state.showHeader;
    }

    render(){
        const { showHeader } = this.state;
        return (
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@4p0ptf`} label={getLabel(84582,'是否显示表头') } labelCol={{span: 6}} wrapperCol={{span: 16}}>
                <div style={{width : '90px', display: 'inline-block', float: 'left'}}>
                    <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@mxd01b`}
                        display="switch"
                        value={showHeader}
                        onChange={v => {
                            this.setState({showHeader : v});
                        }}
                        // disabled={disabled}
                    />
                </div>
            </WeaFormItem>
        )
    }
}


export default EShowHeader;